home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung / Power-Programmierung (Tewi)(1994).iso / magazine / c_news / 16 / sets / setsourc / setassgn.c < prev    next >
C/C++ Source or Header  |  1989-03-09  |  757b  |  28 lines

  1. #include <stdio.h>
  2. #include <stdarg.h>
  3. #include "sets.h"
  4. /***************************************************************************/
  5.                int set_assign(set *destination, set *source)
  6. /***************************************************************************/
  7. /* This function assigns a set value to a set variable or the value of
  8.    one set variable to another.
  9. */
  10. {
  11. int i;
  12.  
  13.     /* check types */
  14.     if(check_set_types(destination,source) == SUCCESS)
  15.         {
  16.         for(i=0;i<destination->member_recs;i++)
  17.             destination->word[i] = source->word[i];
  18.  
  19.         /* correct the member count in the destination set record */
  20.         destination->nmembers = source->nmembers;
  21.         return SUCCESS;
  22.         }
  23.     else
  24.         return FAILURE;
  25.  
  26. }  /* end set_assign */
  27.  
  28.